<script setup>
const props = defineProps(['data']);
console.log(props.data);
const data = history.state;
const {
  fkey: key,
  config_type: configType,
  fvalue: value,
  config_desc: configDesc,
  config_cue: configTip,
  recCreator,
  recCreateTime,
  recReviseTime,
  recRevisor,
  archiveFlag,
  configEnvId
} = data;

const getConigEnv = (envId) => {
  switch (envId) {
    case '1':
      return '平台配置';
    case '2':
      return '';
  }
};
</script>

<template>
  <XPage class="page-main" header title="配置信息">
    <van-cell-group class="info-card" inset>
      <van-cell title="配置名称">{{ key }}</van-cell>
      <van-cell title="配置项类别">{{ configType }}</van-cell>
      <van-cell title="配置项内容">{{ value }}</van-cell>
      <van-cell title="配置项描述">{{ configDesc }}</van-cell>
      <van-cell title="配置项提示">{{ configTip }}</van-cell>
      <van-cell title="状态">{{ data.status }}</van-cell>
      <van-cell title="创建人">{{ recCreator }}</van-cell>
      <van-cell title="创建时间">{{ recCreateTime }}</van-cell>
      <van-cell title="修改时间">{{ recReviseTime }}</van-cell>
      <van-cell title="修改人">{{ recRevisor }}</van-cell>
      <van-cell title="归档标记">{{ archiveFlag }}</van-cell>
      <van-cell title="配置环境标识">{{ getConigEnv(configEnvId) }}</van-cell>
    </van-cell-group>
  </XPage>
</template>

<style lang="stylus" scoped>
.page-main

  .info-card
    margin 12px
</style>
